#ifndef _NTPCLIENT_HPP_
#define _NTPCLIENT_HPP_

#include "jhdefs.hpp"
#include "net/NTPEventArgs.hpp"
#include "net/IPAddress.hpp"
#include "net/SocketAddress.hpp"
#include "event/basicevent.hpp"
using JHCPP::event::TBasicEvent;
#include <string>

NET_NAMESPACE_BEGIN

class CNTPClient
{
public:
	mutable TBasicEvent<CNTPEventArgs> response;
	explicit CNTPClient(CIPAddress::Family family, int timeout = 3000000);
	~CNTPClient();

	int request(CSocketAddress& address) const;
	int request(const std::string& address) const;

private:
	mutable CIPAddress::Family m_family;
	int m_timeout;
};

NET_NAMESPACE_END

#endif
